//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.come.mouslisten;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import org.come.Frame.BoothBoxJframe;
import org.come.Frame.ZhuFrame;
import org.come.entity.Goodstable;
import org.come.entity.RoleSummoning;
import org.come.until.GoodsListFromServerUntil;
import org.come.until.MessagrFlagUntil;

public class TradeChoseGoodsMouslisten implements MouseListener {
    private int index;

    public TradeChoseGoodsMouslisten(int index) {
        this.index = index;
    }

    @Override
    public void mouseClicked(MouseEvent e) {
        Goodstable good = GoodsListFromServerUntil.Getgood(this.index);
        if (good != null) {
            if (GoodsListFromServerUntil.isJY(good)) {
                ZhuFrame.getZhuJpanel().addPrompt2("物品无法交易");
            } else {
                BoothBoxJframe.getBoothboxjframe().getBoothboxjpanel().XZBuy(good, (RoleSummoning)null);
            }
        }
    }

    @Override
    public void mousePressed(MouseEvent e) {
    }

    @Override
    public void mouseReleased(MouseEvent e) {
    }

    @Override
    public void mouseEntered(MouseEvent e) {
        if (GoodsListFromServerUntil.Getgood(this.index) != null) {
            Goodstable goodstable = GoodsListFromServerUntil.Getgood(this.index);
            ZhuFrame.getZhuJpanel().creatgoodtext(goodstable);
            MessagrFlagUntil.setMouse(MessagrFlagUntil.MOUSE12);
        }

    }

    @Override
    public void mouseExited(MouseEvent e) {
        MessagrFlagUntil.setMouse(MessagrFlagUntil.MOUSE1);
        ZhuFrame.getZhuJpanel().cleargoodtext();
    }
}
